package com.xyh;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MemberController {
    @RequestMapping(value="member/{id}",method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
    public Member call(@PathVariable Integer id){
      Member member=new Member();
      member.setId(id);
      member.setName("angus");
      return member;
    }
    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public String hello(){
        return "hello";
    }
    @RequestMapping(value = "/toHello",method = RequestMethod.GET)
    public String  toHello() throws  Exception{
        Thread.sleep(10000);
        return "timeout hello";
    }
}
